
// XortStudio.h : main header file for the XortStudio application
//
#pragma once

#ifndef __AFXWIN_H__
	#error "include 'stdafx.h' before including this file for PCH"
#endif

#include "resource.h"       // main symbols
#include "MainFrm.h"
#include "XortStudioDoc.h"
#include "XortStudioView.h"

// CXortStudioApp:
// See XortStudio.cpp for the implementation of this class
//

class CXortStudioApp : public CWinAppEx
{
public:
	CXortStudioApp();

    inline CMainFrame * GetMainFrame() { return (CMainFrame*)m_pMainWnd; }
    inline COutputWnd * GetOutputWnd() { return GetMainFrame()->GetOutputWnd(); }
    inline CClassView * GetClassView() { return GetMainFrame()->GetClassView(); }
    inline CBreakpointsWnd * GetBreakpointsWnd() { return GetMainFrame()->GetBreakpointsWnd(); }

    CXortStudioDoc* GetActiveXortDocument( CRuntimeClass* pClass );

// Overrides
public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();

// Implementation
	UINT  m_nAppLook;
	BOOL  m_bHiColorIcons;

	virtual void PreLoadState();
	virtual void LoadCustomState();
	virtual void SaveCustomState();

	afx_msg void OnAppAbout();
	DECLARE_MESSAGE_MAP()
};

extern CXortStudioApp theApp;

#define GetApp() (&theApp)
#define GetOutput() theApp.GetOutputWnd()
#define GetClasses() theApp.GetClassView()
#define GetBreakpoints() theApp.GetBreakpointsWnd()

#define GET_ACTIVE_DOC(x) ((x*)theApp.GetActiveXortDocument(RUNTIME_CLASS(x)))
